const webpack = require('webpack')

module.exports = {
    publicPath: './',
    assetsDir: 'static',
    productionSourceMap: false,
    configureWebpack: {
        plugins: [
            new webpack.ProvidePlugin({
                $: "jquery",
                jQuery: "jquery",
                "windows.jQuery": "jquery"
            })
        ]
    },
    devServer: {
        port: 8081,
        hot: true,
        open: true,
        proxy: {
            '/api': {
                target: 'http://localhost:8080',
                changeOrigin: true,
                pathRewrite: {
                    '^/api': ''
                }
            },
            '/ws': {
                target: 'http://localhost:8080',
                changeOrigin: true,
                ws: true
            }
        }
    }
//     target:'http://localhost:8080',pathRewrite:
//     {
//          '/api':'http://localhost:8080'
//    },
//使用ngork代理
    // devServer: {
    //     proxy: {
    //         '/api':{
    //             target:'https://endless-mole-suitably.ngrok-free.app',
    //             changeOrigin:true,
    //             pathRewrite:{
    //                 '/api':'https://endless-mole-suitably.ngrok-free.app'
    //             }
    //         }
    //     }
    // }
};